package net.wofly.sale.stock.util;

/**
 * 入库类型
 * <ul>
 * <li>除了入库单入库外，其它入库都能找到对应的出库</li>
 * <li></li>
 * </ul>
 *
 * @author lign
 * @version 1.0
 * @created 11-10月-2017 21:17:40
 */
public enum InStockType {
    入库单(1, "入库单"),
    宴会退货(2, "宴会退货"),
    领料单(3, "领料单"),
    外购单(4, "外购单"),
    调拔单(5, "调拔单"),
    订货会订单(6, "订货会订单"),
    订单取消(7, "订单取消"),
    订单退货(8, "订单退货");
    
    private Integer value;
    private String name;
    
    private InStockType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (InStockType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (InStockType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}